/**
 * 场景基类
 * 
 * 场景的基本属性状态
 * 
 * @author 
 *
 */
class BaseScene extends BaseDisplay
{
    // 背景层
    protected _background: egret.DisplayObjectContainer;
    // 显示层
    protected _view: egret.DisplayObjectContainer;
    // 弹窗层
    protected _popup: egret.DisplayObjectContainer;
    // 系统信息层
    protected _system: egret.DisplayObjectContainer;
    
	public constructor() {
        super();
	}
	
    protected onCreate(): void 
    {
        // 创建层对象
        this.createBackgroundLayer();
        this.createViewLayer();
        this.createPopupLayer();
        this.createSystemLayer();
        // 指派层级关系 
        this.addChildAt(this._background, 0);
        this.addChildAt(this._view, 1);
        this.addChildAt(this._popup, 2);
        this.addChildAt(this._system, 3);
        super.onCreate();
    }
    
    protected createBackgroundLayer():egret.DisplayObjectContainer 
    {
        this._background = new egret.DisplayObjectContainer();
        return this._background;
    }
    
    protected createViewLayer():egret.DisplayObjectContainer 
    {
        this._view = new egret.DisplayObjectContainer();
        return this._view;
    }
    
    protected createPopupLayer():egret.DisplayObjectContainer 
    {
        this._popup = new egret.DisplayObjectContainer();
        return this._popup;
    }
        
    protected createSystemLayer():egret.DisplayObjectContainer 
    {
        this._system = new egret.DisplayObjectContainer();
        return this._system;
    }  

    public getBackgroundLayer():egret.DisplayObjectContainer 
    {
        return this._background;
    }
        
    public getViewLayer():egret.DisplayObjectContainer 
    {
        return this._view;
    }
        
    public getPopupLayer():egret.DisplayObjectContainer 
    {
        return this._popup;
    }
            
    public getSystemLayer():egret.DisplayObjectContainer 
    {
        return this._system;
    } 
    
    protected onExit(): void 
    {
        this._background = null;
        this._view = null;
        this._popup = null;
        this._system = null;
        super.onExit();
    }
    
    // 初始化当前所有事件监听
    protected initAllEventListener():void 
    {
        // todo
    }
    
    // 移除当前所有事件监听
    protected deleteAllEventListener():void 
    {
        // todo
    }
}
